package com.xiaochi.wx.handler;

/**
 * 微信消息枚举类
 * @author zqx
 * @since 2024/8/31
 */
public enum WxchatMsgTypeEnum {

    SUBSCRIBE("event.subscribe","用户关注事件"),
    TEXT("text","接收用户文本消息");

    private String msgType;

    private String desc;

    WxchatMsgTypeEnum(String msgType,String desc){
        this.desc = desc;
        this.msgType = msgType;
    }

    public static WxchatMsgTypeEnum getByMsgType(String msgType){
        for (WxchatMsgTypeEnum wxchatMsgTypeEnum : WxchatMsgTypeEnum.values()){
            if (msgType.equals(wxchatMsgTypeEnum.msgType)){
                return wxchatMsgTypeEnum;
            }
        }
        return null;
    }
}
